package com.common.displayObjects
{
	import flash.geom.Rectangle;
	import flash.utils.Timer;
	
	
	public class Application extends ComponentChildren
	{
		private var _w:Number, _h:Number;
		//最低层
		public var baselayer:ComponentChildren;
		//地图层
		public var mapLayer:ComponentChildren;
		//绘图层， 人物层
		public var uiLayer:ComponentChildren;
		//效果层
		public var effectLayer:ComponentChildren;
		//窗口层
		public var popUpManager:PopUpManager;
		//极限层
		public var limitLayer:ComponentChildren;
		
		public function Application(width:Number, height:Number)
		{
			super(width, height);
			initLayer();
		}
		
		private function initLayer():void
		{
			baselayer = new ComponentChildren(width, height);
			mapLayer = new ComponentChildren(width, height);
			uiLayer = new ComponentChildren(width, height);
			effectLayer = new ComponentChildren(width, height);
			popUpManager = new PopUpManager(width, height);
			limitLayer = new ComponentChildren(width, height);
			
			addChild(baselayer);
			addChild(mapLayer);
			addChild(uiLayer);
			addChild(effectLayer);
			addChild(popUpManager);
			addChild(limitLayer);
		}
		
		override public function resize(_w:Number, _h:Number):void
		{
			super.resize(_w, _h);
			
			baselayer.resize(_w, _h);
			mapLayer.resize(_w, _h);
			uiLayer.resize(_w, _h);
			effectLayer.resize(_w, _h);
			popUpManager.resize(_w, _h);
			limitLayer.resize(_w, _h);
		}
		
	}
}